<?php
/*类文件自动引入
*/
function import($sfilename)
{
	if( TRUE == @is_readable($sfilename) )
	{
		require($sfilename); 
		return TRUE;
	}
	else
	{
		// 类(自动)加载
		if (substr($target,-11) == 'ControlPage') 
		{
			$sfilename = PO_PATH."/source/app/{$target}.php";
		} 
		elseif(substr($target,0,6) == 'class_') 
		{
			$sfilename = PO_PATH."/source/class/{$target}.php";
		}
		else if(substr($target,-6) == 'Entity')
		{
			$sfilename = PO_PATH."/source/entity/{$target}.php";
		}
		if (!file_exists($sfilename)) 
		{
        	halt('file not found:'.$sfilename);
   		}
	}
	halt('file not found:'.$sfilename);
}

function formhash() {
    return substr(md5($_SERVER['HTTP_USER_AGENT'].'cevin&authkey'.substr(time(),0,5)),16);
}


function halt($message) {
    exit($message);
}
?>